
from typing import Tuple
from PIL import Image
from marker.schema import BlockTypes
from marker.schema.blocks import Block
from typing import Annotated, List

from ..processors import BaseOptProcessor


class OptTableProcessor(BaseOptProcessor):
    block_types: Annotated[
        Tuple[BlockTypes],
        "The block types to process.",
    ] = (BlockTypes.Table, )

    def process_rewriting(self,
            doc_blocks: List[Block],
            block_images: List[Image.Image]
    ):
        block_datas = []
        for block, image in zip(doc_blocks, block_images):
            block_datas.append({
                'id': str(block.id),
                'html': 'Table parse by UniTable Model...'
            })
        return block_datas